package daxiniot.bttemphumidity;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

public class DatabaseHelper extends SQLiteOpenHelper {
    public static final String CREATE_USERDATA = "create table user_data("
            + "id integer primary key autoincrement,"
            + "time varchar(20),"
            + "clock varchar(20),"
            + "temperature int,"
            + "humidity int"+")";



    //带全部参数的构造函数，此构造函数必不可少
    public DatabaseHelper(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
    }
    @Override
    public void onCreate(SQLiteDatabase db) {
        Log.i("数据库创建", "创建开始");
        db.execSQL(CREATE_USERDATA);
        Log.i("数据库创建", "创建成功");
    }

    @Override
    public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {

    }
}
